package edu.the.last.chord.factory.simple;

import java.util.List;

import edu.the.last.Messages;

/**
 * a helper class for the SimpleChord class
 * 
 * @author albertcsani
 * 
 */
public class SimpleScale {
	private String scale = Messages.getString("SimpleScale.Default"); //$NON-NLS-1$
	private List<String> notes;

	public SimpleScale(String scale, List<String> notes) {
		this.scale = scale;
		this.notes = notes;
	}

	/**
	 * 
	 * @return the scales name
	 */
	public String getScale() {
		return scale;
	}

	/**
	 * determines the "goodness" of a given note on this scale
	 * 
	 * @param note
	 *            the note
	 * @return a value representing the "goodness" (0->5)
	 */
	public int getNoteValue(String note) {
		int value = notes.indexOf(note);
		switch (value) {
		case -1:
			return 0;
		case 0:
			return 1;
		case 1:
			return 1;
		case 2:
			return 3;
		case 3:
			return 5;
		case 4:
			return 5;
		default:
			return 0;
		}
	}
}
